<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>修改</title>

    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">

    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.min.js"></script>
</head>
<style type="text/css">
    td {
        width: 500px;
    }
    table {
        margin: 50px auto;
    }
    #type{
        width: 80px;
        height: 25px;
    }
    a:hover{
        color: skyblue;
    }
    #textarea{
        height: 200px;
        width: 400px;
    }
</style>
<body>
<%@include file="index.jsp"%>
<h1 style="text-align: center">修改</h1>
<table border="1" cellspacing="0" cellpadding="20">

    <form action="${pageContext.request.contextPath}/update" method="post">
            <input type="hidden" name="id" value="${cust.id}">
        <tr>
            <th>用户名:</th>
            <td><input type="text" class="form-control" placeholder=".col-lg-3" style="color: red;background-color: darkgray"   name="username" id="username" value="${cust.username}" size="30"  readonly /></td>
        </tr>
        <tr>
            <th>性别:</th>
            <td>
                <input type="radio" name="gender"  value="nan" ${cust.gender == 'nan'?'checked':''} />男
                <input type="radio" name="gender"  value="nv" ${cust.gender == 'nv'?'checked':''} />女
            </td>
        </tr>

        <tr>
            <th>生日:</th>
            <td>
                <input type="date" name="birthday" id="birthday" value="${cust.birthday}" size="30" />
            </td>
        </tr>

        <tr>
            <th>手机号码:</th>
            <td ><input type="text" class="form-control" placeholder=".col-lg-3" name="phonenum" id="phonenum" value="${cust.phonenum}" size="30" /></td>
        </tr>

        <tr>
            <th>邮箱:</th>
            <td><input type="text" class="form-control" name="email" id="email" value="${cust.email}" size="30" /></td>
        </tr>

        <tr>
            <th>爱好:</th>
            <td>
                <input type="checkbox" name="hobby" size="30" value="basketball"
                ${fn:contains(cust.hobby,'basketball')?'checked':''}
                />篮球
                <input type="checkbox" name="hobby" size="30" value="football"
                ${fn:contains(cust.hobby,'football')?'checked':''}
                />足球
                <input type="checkbox" name="hobby" size="30" value="dance"
                ${fn:contains(cust.hobby,'dance')?'checked':''}
                />跳舞
                <input type="checkbox" name="hobby" size="30" value="music"
                ${fn:contains(cust.hobby,'music')?'checked':''}
                />音乐
            </td>

        </tr>
        <tr>
            <th>类型:</th>
            <td><select name="type" id="type">
                <option value="">请选择</option>
                <option value="黑铁客户"${cust.type == '黑铁客户'?'selected':''}>黑铁客户</option>
                <option value="青铜客户"${cust.type == '青铜客户'?'selected':''}>青铜客户</option>
                <option value="黄金客户" ${cust.type == '黄金客户'?'selected':''}>黄金客户</option>
                <option value="钻石客户" ${cust.type == '钻石客户'?'selected':''}>钻石客户</option>
            </select>
            </td>
        </tr>
        <tr>
            <th>自我介绍:</th>
            <td>
                <textarea name="introduce" value="introduce" id="textarea">${cust.introduce}</textarea>
            </td>
        </tr>
        <tr>
            <td style="text-align: center" colspan="2">
                <input type="button" value="修改" onclick="xiugai()">
            </td>
        </tr>
    </form>
</table>
</body>
</html>
<script src="${pageContext.request.contextPath}/js/jquery-1.12.4.min.js"></script>
<script>

    function xiugai(){
        var isxiu = confirm("您确认修改吗?");
        if(isxiu){
            document.forms[0].submit();
        }
    }

</script>